# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=fernmelder
pkgver=0.4s2.r2.g030212e
pkgrel=1
epoch=1
groups=('blackarch' 'blackarch-scanner' 'blackarch-recon')
pkgdesc='Asynchronous mass DNS scanner.'
arch=('x86_64' 'aarch64')
makedepends=('git')
url='https://github.com/stealth/fernmelder'
license=('GPL-3.0-or-later')
source=("git+https://github.com/stealth/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  ) | sed 's|fernmelder.||g'
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

